package lexer;

/**
 * Token类型表
 */
public enum TokenType {
    Ident,//标识符
    Number,//无符号整数

    If, //if
    Else, //else
    While, //while
    Break, //break
    Continue, //continue
    Return, //return

    Const, //const
    Int, //int
    Void, //void

    Assign, // =   //需要假读判断==
    Semicolon,// ;
    Comma, // ,
    LPar, // (
    RPar, // )
    LBrace, // {
    RBrace, // }
    LSquare,// [
    RSquare, // ]

    Plus,// +
    Minus, // -
    Mult, // *
    Div, //  /   // 需要假读判断是否是注释
    Modulo, // %

    Lt, //  <   // 需要假读
    Gt, // >   // 需要假读
    Lte, // <=
    Gte, // >=
    Eq, // ==
    NEq, // !=

    And, // &&
    Or, // ||
    Not, // !  // 需要假读

    EOF; // 文件结尾


    @Override
    public String toString() {
        switch (this) {
//            case LLVMir:
//                return "LLVMIR";
            case Eq:
                return "Eq";
            case Gt:
                return "Gt";
            case If:
                return "If";
            case Lt:
                return "Lt";
            case Or:
                return "Or";
            case And:
                return "And";
            case Div:
                return "Div";
            case EOF:
                return "EOF";
            case Gte:
                return "Gte";
            case Int:
                return "Int";
            case Lte:
                return "Lte";
            case NEq:
                return "NEq";
            case Not:
                return "Not";
            case Else:
                return "Else";
            case LPar:
                return "LPar";
            case Mult:
                return "Mult";
            case Plus:
                return "Plus";
            case RPar:
                return "RPar";
            case Void:
                return "Void";
            case Break:
                return "Break";
            case Comma:
                return "Comma";
            case Const:
                return "Const";
            case Ident:
                return "Ident";
            case Minus:
                return "Minus";
            case While:
                return "While";
            case Assign:
                return "Assign";
            case LBrace:
                return "LBrace";
            case Modulo:
                return "Modulo";
            case Number:
                return "Number";
            case RBrace:
                return "RBrace";
            case Return:
                return "Return";
            case LSquare:
                return "LSquare";
            case RSquare:
                return "RSquare";
            case Continue:
                return "Continue";
            case Semicolon:
                return "Semicolon";
            default:
                return "???";
        }
    }
}
